package com.xwj.exception.demo.controller;

import com.xwj.common.util.R;
import com.xwj.exception.demo.dto.StudentDTO;
import com.xwj.exception.demo.service.StudentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName StudentController
 * @Description
 * @Author wxf
 * @Date 2022/4/18 15:36
 * @Version 1.0
 */
@Slf4j
@RestController
@RequestMapping(value = "/student")
@Api(value = "StudentController", tags = "测试接口")
public class StudentController {

    @Autowired
    private StudentService studentService;

    @ApiOperation(value = "学员详情")
    @PostMapping(value = "/getStudentInfo")
    public R getUser(@RequestParam("studentId") Integer studentId) {
        StudentDTO studentDTO = studentService.queryStudentById(studentId);
        return R.ok().put("data", studentDTO);

    }

}
